package com.smartleanx.module.hrm.controller.admin.companysystememployee;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.*;

import com.smartleanx.framework.common.pojo.CommonResult;

import static com.smartleanx.framework.common.pojo.CommonResult.success;

import com.smartleanx.module.hrm.controller.admin.companysystememployee.vo.*;
import com.smartleanx.module.hrm.service.companysystememployee.CompanySystemEmployeeService;

@Tag(name = "管理后台 - 公司制度已学习")
@RestController
@RequestMapping("/hrm/company-system-employee")
@Validated
public class CompanySystemEmployeeController {

    @Resource
    private CompanySystemEmployeeService companySystemEmployeeService;

    @PostMapping("/create")
    @Operation(summary = "员工端确认已学习公司制度")
    @PreAuthorize("@ss.hasPermission('hrm:company-system-employee:create')")
    public CommonResult<Long> createCompanySystemEmployee(@Valid @RequestBody CompanySystemEmployeeSaveReqVO createReqVO) {
        return success(companySystemEmployeeService.createCompanySystemEmployee(createReqVO));
    }
}
